package com.portal.portal.config.service;

import javax.servlet.ServletContext;

import com.google.inject.Inject;
import com.portal.util.exception.PortalDriverConfigurationException;

public class DriverConfigurationServiceFacade{

  @Inject
  private static DriverBasicInfoService driverBasicInfoService;
  @Inject
  private static DriverPortalURLParseService driverPortalURLParseService;
  @Inject
  private static DriverRenderService driverRenderService;
  @Inject
  private static DriverSupportedModesService driverSupportedModesService;
  @Inject
  private static DriverWindowStateService driverWindowStateService;

  public DriverBasicInfoService getDriverBasicInfoService() {
    return driverBasicInfoService;
  }

  public DriverPortalURLParseService getDriverPortalURLParseService() {
    return driverPortalURLParseService;
  }

  public DriverRenderService getDriverRenderService() {
    return driverRenderService;
  }

  public DriverSupportedModesService getDriverSupportedModesService() {
    return driverSupportedModesService;
  }

  public DriverWindowStateService getDriverWindowStateService() {
    return driverWindowStateService;
  }

  public static void destroy() throws PortalDriverConfigurationException {
    driverBasicInfoService.destroy();
    driverPortalURLParseService.destroy();
    driverRenderService.destroy();
    driverSupportedModesService.destroy();
    driverWindowStateService.destroy();
  }

  public static void init(ServletContext servletContext) throws PortalDriverConfigurationException {
    driverBasicInfoService.init(servletContext);
    driverPortalURLParseService.init(servletContext);
    driverRenderService.init(servletContext);
    driverSupportedModesService.init(servletContext);
    driverWindowStateService.init(servletContext);
  }

  public static void setDriverBasicInfoService(DriverBasicInfoService driverBasicInfoService) {
    DriverConfigurationServiceFacade.driverBasicInfoService = driverBasicInfoService;
  }

  public static void setDriverPortalURLParseService(DriverPortalURLParseService driverPortalURLParseService) {
    DriverConfigurationServiceFacade.driverPortalURLParseService = driverPortalURLParseService;
  }

  public static void setDriverRenderService(DriverRenderService driverRenderService) {
    DriverConfigurationServiceFacade.driverRenderService = driverRenderService;
  }

  public static void setDriverSupportedModesService(DriverSupportedModesService driverSupportedModesService) {
    DriverConfigurationServiceFacade.driverSupportedModesService = driverSupportedModesService;
  }

  public static void setDriverWindowStateService(DriverWindowStateService driverWindowStateService) {
    DriverConfigurationServiceFacade.driverWindowStateService = driverWindowStateService;
  }

}
